package com.asiainfo.dacp.common.utils;

import java.util.ArrayList;

public class HiveSchemaUtils {

    //获取hiveschema
    public static String getHiveSchema(ArrayList<String> columns) {
        StringBuilder schema = new StringBuilder();

        schema.append("struct<");
        for (int i = 0; i < columns.size(); i++) {
            if (i==columns.size()-1){
                schema.append(columns.get(i)).append(":string>");
                break;
            }
            schema.append(columns.get(i)).append(":string,");
        }
        return schema.toString();
    }
}
